using System;
using System.Xml.Serialization;

namespace com.exceptionalsoftware.spacetime.KML
{
	[Serializable()]
    [XmlType(TypeName = "ContainerType")]
    [XmlInclude(typeof(Document))]
    [XmlInclude(typeof(Folder))]
	public abstract class Container : Feature
	{
        private SimpleGenericList<Feature> featuresField;


        public Container()
		{
            this.featuresField = new SimpleGenericList<Feature>();
		}

        [XmlElement(ElementName = "Folder", Type = typeof(Folder))]
        [XmlElement(ElementName = "Document", Type = typeof(Document))]
        [XmlElement(ElementName = "Placemark", Type = typeof(Placemark))]
        [XmlElement(ElementName = "NetworkLink", Type = typeof(NetworkLink))]
        [XmlElement(ElementName = "GroundOverlay", Type = typeof(GroundOverlay))]
        [XmlElement(ElementName = "ScreenOverlay", Type = typeof(ScreenOverlay))]
        [XmlElement(ElementName = "PhotoOverlay", Type = typeof(PhotoOverlay))]
        public Feature[] Items
        {
            get { return this.featuresField.ToArray(); }
            set { this.featuresField = new SimpleGenericList<Feature>(value); }
        }

        [XmlIgnore()]
        public SimpleGenericList<Feature> Features
        {
            get { return this.featuresField; }
        }
    }
}